//
//  AdviceViewController.m
//  AnnCar_user
//
//  Created by LiBenCan on 17/10/26.
//  Copyright © 2017年 LiBenCan. All rights reserved.
//

#import "AdviceViewController.h"
#import "SelfTextView.h"
#import "UILabel+HWDUILabel.h"
#import "TextFiledView.h"
@interface AdviceViewController ()
@property (nonatomic,strong)SelfTextView *adviceTextV;//意见反馈输入框
@property (nonatomic,strong)CanLab *btnLab;//提交
@property (nonatomic,strong)UIImageView *phoneImageV;//电话图片
@property (nonatomic,strong)CanLab *phoneBtnLab;//电话

@end

@implementation AdviceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initTitleWithTitle:@"意见反馈"];
    [self initLeftBarButtonWithImage:@"back"];
    self.view.backgroundColor = backColor;
    [self.view addSubview:self.adviceTextV];
    [self.view addSubview:self.btnLab];
    [self addPhoneView];
}

//意见输入框
-(SelfTextView *)adviceTextV
{
    if (!_adviceTextV) {
        _adviceTextV = [[SelfTextView alloc]initWithFrame:CGRectMake(15*screenW_6,15*screenW_6, SCREENW-30*screenW_6, 200*screenW_6) PlaceHodel:@"请输入你的宝贵意见"];
    }
    return _adviceTextV;
}

//保存按钮
-(CanLab *)btnLab
{
    if (!_btnLab) {
        _btnLab = [[CanLab alloc]initWithFrame:CGRectMake(10*screenW_6, CGRectGetMaxY(_adviceTextV.frame)+20*screenW_6, SCREENW-20*screenW_6, 44*screenW_6) textAligment:1 font:15*screenW_6 textColor:@"#ffffff" text:@"保存"];
        _btnLab.backgroundColor = blueColor;
        [_btnLab.layer setCornerRadius:5];
        _btnLab.layer.masksToBounds = YES;
    }
    return _btnLab;
}

//添加手机号码
-(void)addPhoneView
{
    _phoneImageV = [TomamaUI createImageView:CGRectMake(15*screenW_6, CGRectGetMaxY(self.btnLab.frame)+20*screenW_6, 20*screenW_6, 22*screenW_6) backGroundImageV:@"My_grayphone"];
    [self.view addSubview:_phoneImageV];
    
    _phoneBtnLab = [[CanLab alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_phoneImageV.frame)+10*screenW_6, CGRectGetMaxY(self.btnLab.frame)+25*screenW_6,SCREENW-60*screenW_6, 20*screenW_6) textAligment:0 font:16*screenW_6 textColor:@"#ff6000" text:[NSString stringWithFormat:@"投诉电话：18526552750"]];
    [self.view addSubview:_phoneBtnLab];
    [_phoneBtnLab setHighlightStirng:@"投诉电话：" HighlightColor:TextBlack];
    _phoneBtnLab.block = ^(CanLab *lab){//拨打电话
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"tel://%@",@"18326552750"]]];
    };
}




@end
